<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<style type="text/css">
.dateWidth1{
   width:195px;
}
.select_width{
   width:130px;
}
</style>

<table class="t_css table01" width="100%" border="0" cellpadding="0" id="basicInfo"
	cellspacing="1">
	<col style="width:18%"/>
	<col style="width:16%"/>
	<col style="width:16%"/>
	<col style="width:18%"/>
	<col style="width:16%"/>
	<col style="width:16%"/>
	<tr class="li_1">
		<td   colspan="6" class="t_bar2">${param.title}</td>
		
	</tr>
	<tr class="li_2">
		<td   align="right" ><span class="color_red">*</span>项目名称：</td>
		<td  colspan="5">
			<input id="zh_title" name="proposal/zh_title" label="${param.title}-->项目名称" type="text" required class="input_css required maxlength:100"  style="width:604px;" maxlength="100" value="<x:out select="$xmlData/data/proposal/zh_title" />"/> 
		</td>
	</tr>
	<tr class="li_1">
		<td   align="right" ><span class="color_red">*</span>所属行业：</td>
		<td  colspan="5">
			<c:set var="belon_industry">{'id':'<x:out select="$xmlData/data/proposal/belon_industry_code" />','name':'<x:out select="$xmlData/data/proposal/belon_industry_name" />'}</c:set>
       		 <cpt:tree key="belon_industry" cacheable="false" className="hn_iuput_kuang" readonly="true" value="${belon_industry}"  label="${param.title}-->所属行业" 
          		    id="belon_industry" showPattern="current" shieldPattern="0" topCheckbox="false" onClick="initTreeValueTeamPerson" />
	         <input id="belon_industry_code" type="hidden" name="proposal/belon_industry_code" class="required" label="${param.title}-->所属行业" value="<x:out select="$xmlData/data/proposal/belon_industry_code" />"/>
            <input id="belon_industry_name" type="hidden" name="proposal/belon_industry_name"  value="<x:out select="$xmlData/data/proposal/belon_industry_name" />"/>
		</td>
	</tr>
	<tr class="li_2">
		<td   align="right" ><span class="color_red">*</span>所属产业：</td>
		<td  colspan="2">
			<c:set var="industr_type"><x:out select="$xmlData/data/proposal/industr_type_value" /></c:set>
			<cpt:select id="industr_type" style="width:148px;"  key="industr_type2"  value="${industr_type}" onChange="initControlValue(this.id);"></cpt:select>
			<input type="hidden" id="industr_type_value" name="proposal/industr_type_value" class="required" value="${industr_type}" label="${param.title}-->所属产业">
			<input type="hidden" name="proposal/industr_type_name" value="<x:out select="$xmlData/data/proposal/industr_type_name" />">
		</td>
		<td   align="right" ><span class="color_red">*</span>所属学科：</td>
		<td  colspan="2">
          	<c:set var="subject">{'id':'<x:out select="$xmlData/data/proposal/subject_code" />','name':'<x:out select="$xmlData/data/proposal/subject_name" />'}</c:set>
          	<cpt:tree key="medically" cacheable="false" className="hn_iuput_kuang" readonly="true" value="${subject}"  label="${param.title}-->所属学科" 
          		id="subject" showPattern="current" shieldPattern="0" topCheckbox="false" onClick="initTreeValue2" />
	        <input id="subject_code" type="hidden" name="proposal/subject_code" class="required" label="${param.title}-->所属学科" value="<x:out select="$xmlData/data/proposal/subject_code" />"/>
            <input id="subject_name" type="hidden" name="proposal/subject_name"  value="<x:out select="$xmlData/data/proposal/subject_name" />"/>
		</td>
	</tr>
	<tr class="li_1">
	<td  align="right" nowrap><span class="color_red">*</span>技术领域：</td>
	<td colspan="2">
			 <c:set var="grantCode"><x:out select="$xmlData/data/proposal/grant_code" /></c:set>
			<c:set var="sub"><x:out select="$xmlData/data/proposal/sub_grant_code" /></c:set>
			<c:set var="researcharea_all_value"><x:out select="$xmlData/data/proposal/researcharea_all_value" /></c:set>
			<c:set var="researcharea">{'id':'<x:out select="$xmlData/data/proposal/researcharea_all_value" />','name':'<x:out select="$xmlData/data/proposal/researcharea_all_name" />'}</c:set>
			<c:if test="${empty researcharea_all_value }"><c:set var="researcharea">{'id':'<x:out select="$xmlData/data/proposal/researcharea_value" />','name':'<x:out select="$xmlData/data/proposal/researcharea_name" />'}</c:set></c:if>
          	<cpt:tree key="researcharea1" cacheable="false" className="hn_iuput_kuang" readonly="true" value="${researcharea}"  label="${param.title}-->技术领域"
          		id="researcharea" onlyChooseLeaf="false" showPattern="parent" shieldPattern="0" topCheckbox="true" onClick="localInitTreeValue" sqlParamVal="{grant_code:${sub},stat_year:${param.statYear }}"/>
	        <input id="researcharea_value" type="hidden" name="proposal/researcharea_value" class="required" label="${param.title}-->技术领域" value="<x:out select="$xmlData/data/proposal/researcharea_value" />"/>
            <input id="researcharea_name" type="hidden" name="proposal/researcharea_name"  value="<x:out select="$xmlData/data/proposal/researcharea_name" />"/>
             <input id="researcharea_all_name" type="hidden" name="proposal/researcharea_all_name"  value="<x:out select="$xmlData/data/proposal/researcharea_all_name" />"/>
			 <input  type="hidden" id="researcharea_all_value" name="proposal/researcharea_all_value"  value="<x:out select="$xmlData/data/proposal/researcharea_all_value" />"/>
	</td>
	<td  align="right" nowrap>专题名称：</td>
	<td colspan="2">
	        <input id="domain_value" type="hidden" name="proposal/domain_value"  value="<x:out select="$xmlData/data/proposal/domain_value" />"/>
            <span id="domain_name"  name="proposal/domain_name"><x:out select="$xmlData/data/proposal/domain_name" /></span>
            <input id="subject_no" type="hidden" name="proposal/subject_no"  value="<x:out select="$xmlData/data/proposal/subject_no" />"/>
	</td>
	</tr>
	<tr class="li_2">
	<td  align="right" nowrap><span class="color_red">*</span>项目开始日期：</td>
		<td colspan="2">
			<c:set var="start_date"><x:out select="$xmlData/data/proposal/start_date" /></c:set>
			<cpt:date id="start_date" name="proposal/start_date" value="${start_date}" className="required date  dateCompare:end_date" label="${param.title}-->项目开始日期" ></cpt:date> 
		</td>
		<td  align="right" nowrap ><span class="color_red">*</span>项目结束日期：</td>
		<td colspan="2">
			<c:set var="end_date"><x:out select="$xmlData/data/proposal/end_date" /></c:set>
			<cpt:date id="end_date" name="proposal/end_date" className="required date" label="${param.title}-->项目结束日期"  value="${end_date}" ></cpt:date> 
		</td>
	</tr>
	<tr class="li_1">
	    <td  align="right" ><span class="color_red">*</span>申报日期：</td>
		<td colspan="2">
			<c:set var="submit_date"><x:out select="$xmlData/data/proposal/submit_date" /></c:set>
			<cpt:date id="submit_date" name="proposal/submit_date" value="${submit_date}" className=" required date" label="${param.title}-->申报日期"></cpt:date> 
		</td>
		 <td  align="right" >归口管理部门：</td>
		<td colspan="2">
			<x:out select="$xmlData/data/proposal/tjbm_org_name" />
		</td>
	</tr>
		<tr class="li_2">
	<td align="right">依托平台（重点实验&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br/>室、工程技术中心等）：</td>
	<td nowrap  colspan="2" valign="middle">
	<label> <input type="checkbox" class="do " id="advant_01" style="vertical-align: middle;" name="innovate2" label="国家级" value="01" /><span style="vertical-align: middle;">国家级</span></label>&nbsp; &nbsp; &nbsp;  
	<label> <input type="checkbox" class="do " id="advant_02" style="vertical-align: middle;" name="innovate2" label="省部级" value="02" /><span style="vertical-align: middle;">省部级</span></label>&nbsp; &nbsp; &nbsp; 
	<label> <input type="checkbox" class="do" id="advant_03" style="vertical-align: middle;" onclick="showText(this);" name="innovate2" label="其他" value="03" /><span style="vertical-align: middle;">其他</span></label>
    <input type="text" name="proposal/innovate2_other" id="innovate2_other"  class="input_css  maxlength:100" style="display:none;width:95px;"  maxlength="100" value="<x:out select="$xmlData/data/proposal/innovate2_other" />" label="${param.title}-->依托平台（重点实验室、工程技术中心等）-->其他" /> 
	
	<input type="hidden" name="proposal/innovate2_value" id="innovate2_value" class="" value="<x:out select="$xmlData/data/proposal/innovate2_value" />" label="${param.title}-->依托平台" /> 
	<input type="hidden" name="proposal/innovate2_name" id="innovate2_name" value="<x:out select="$xmlData/data/proposal/innovate2_name" />" label="${param.title}-->依托平台" /></td>
	<td align="right">所属创新团队：</td>
	<td nowrap  colspan="2" valign="middle">
	<label> <input type="checkbox" class="do " id="innovate_team_01" style="vertical-align: middle;" name="innovate_team" label="国家级" value="01" /><span style="vertical-align: middle;">国家级</span></label>&nbsp; &nbsp; &nbsp;  
	<label> <input type="checkbox" class="do " id="innovate_team_02" style="vertical-align: middle;" name="innovate_team" label="省部级" value="02" /><span style="vertical-align: middle;">省部级</span></label>&nbsp; &nbsp; &nbsp;  
	<label> <input type="checkbox" class="do " id="innovate_team_03" style="vertical-align: middle;" onclick="showText(this);" name="innovate_team" label="其他" value="03" /><span style="vertical-align: middle;">其他</span></label>
	<input type="text" name="proposal/innovate_team_other" id="innovate_team_other"  class="input_css  maxlength:100" style="display:none;width:95px;"  maxlength="100" value="<x:out select="$xmlData/data/proposal/innovate_team_other" />" label="${param.title}-->所属创新团队-->其他" /> 
	
	<input type="hidden" name="proposal/innovate_team_value" id="innovate_team_value" class="" value="<x:out select="$xmlData/data/proposal/innovate_team_value" />" label="${param.title}-->所属创新团队" /> 
	<input type="hidden" name="proposal/innovate_team_name" id="innovate_team_name" value="<x:out select="$xmlData/data/proposal/innovate_team_name" />" label="${param.title}-->所属创新团队" /></td>
	</tr>
	</table>
	<br/>
<script type="text/javascript">
function initTreeValueTeamPerson(treeId, treeNode) {
  	//针对单位性质
  	if (( treeNode && treeNode.isParent)) {
		scmWarn("请选择具体的"+$("#" + treeId).attr("label"));
			$("#" + treeId).val("");
			$("#" + treeId).parents("td").find("[name$='" + treeId + "_code'],[id$='" + treeId+ "_code']").val("");
			$("#" + treeId).parents("td").find("[name$='" + treeId + "_value'],[id$='" + treeId+ "_value']").val("");
			$("#" + treeId).parents("td").find("[name$='" + treeId + "_name'],[id$='" + treeId+ "_name']").val("");
			return false;
	}
		var str = treeNode.name.split("-")[0];
		var obj = treeNode.parentNode;
		while (obj != null) {
			//str = obj.name + "-" + str;
			obj = obj.parentNode;
		}
		$("#" + treeId).parents("td").find("[name$='" + treeId + "_code'],[id$='" + treeId + "_code']").val(treeNode.id);
		$("#" + treeId).parents("td").find("[name$='" + treeId + "_value'],[id$='" + treeId + "_value']").val(treeNode.id);
		$("#" + treeId).parents("td").find("[name$='" + treeId + "_name'],[id$='" + treeId + "_name']").val(str);
		$("#" + treeId).val(str);
		initTreeValue2CallBack();
	}

  function setZhTitle(obj){
	  $("#intro_zh_title").text($(obj).val());
  }
  function localInitTreeValue(treeId, treeNode) {
		var str = treeNode.name;
		var obj = treeNode.parentNode;
		if (!(treeNode && (treeNode.level > 0 || !treeNode.isParent))) {
			scmWarn($("#" + treeId).attr("label")
					+ messageTip.researchAreaInvalidDisciplineCode);
			return false;
		}
		
		var showName = "";
		var parentId="";
		if (treeNode!=null && treeNode.level == 1) {//选择二级
		    str = obj.name + "-" + str;
			//obj = obj.parentNode;
			showName = obj.name;
			parentId=obj.id;
			$("#" + treeId).val(showName);
			$("#" + treeId).parents("tr").find("[name$='domain_value']").val(treeNode.id);
			$("#" + treeId).parents("tr").find("[name$='subject_no']").val(str.split("_")[str.split("_").length-1]);
			$("#" + treeId).parents("tr").find("[name$='domain_name']").text(treeNode.name.split("_")[0]);
			$("#" + treeId).parents("td").find("[name$='" + treeId + "_value'],[id$='" + treeId + "_value']").val(parentId);
			$("#" + treeId).parents("td").find("[name$='" + treeId + "_name'],[id$='" + treeId + "_name']").val(showName);
			$("#" + treeId).parents("td").find("[name$='" + treeId + "_all_name'],[id$='" + treeId + "_all_name']").val(str);
			$("#" + treeId).parents("td").find("[name$='" + treeId + "_all_value'],[id$='" + treeId + "_all_value']").val(treeNode.id);
		}else if(treeNode!=null && treeNode.level == 2){//选择三级
			str = obj.name + "-" + str;
			obj = obj.parentNode;
			showName = obj.name;
			parentId=obj.id;
			$("#" + treeId).val(showName);
			$("#" + treeId).parents("tr").find("[name$='domain_value']").val(treeNode.parentNode.id);
			$("#" + treeId).parents("tr").find("[name$='subject_no']").val(str.split("_")[1].split("-")[0]);
			$("#" + treeId).parents("tr").find("[name$='domain_name']").text(str.split("_")[0]);
			$("#" + treeId).parents("td").find("[name$='" + treeId + "_value'],[id$='" + treeId + "_value']").val(parentId);
			$("#" + treeId).parents("td").find("[name$='" + treeId + "_name'],[id$='" + treeId + "_name']").val(showName);
			$("#" + treeId).parents("td").find("[name$='" + treeId + "_all_name'],[id$='" + treeId + "_all_name']").val(str);
			$("#" + treeId).parents("td").find("[name$='" + treeId + "_all_value'],[id$='" + treeId + "_all_value']").val(treeNode.id);
		}else{
			$("#" + treeId).val(str);
			$("#"+treeId).parents("tr").find("[name$='domain_value']").val("");
			$("#"+treeId).parents("tr").find("[name$='subject_no']").val("");
		    $("#"+treeId).parents("tr").find("[name$='domain_name']").text("");
			$("#" + treeId).parents("td").find("[name$='" + treeId + "_all_name'],[id$='" + treeId + "_all_name']").val("");
			$("#" + treeId).parents("td").find("[name$='" + treeId + "_all_value'],[id$='" + treeId + "_all_value']").val("");
			$("#" + treeId).parents("td").find("[name$='" + treeId + "_value'],[id$='" + treeId + "_value']").val(treeNode.id);
			$("#" + treeId).parents("td").find("[name$='" + treeId + "_name'],[id$='" + treeId + "_name']").val(str);
		}
		
 }
  function setEmptyValueForTree(id){
	    $("#"+id).parents("tr").find("[name$='domain_value']").val("");
		$("#"+id).parents("tr").find("[name$='subject_no']").val("");
		$("#"+id).parents("tr").find("[name$='domain_name']").text("");
		$("#" + id).parents("td").find("[name$='" + id + "_all_name'],[id$='" + id + "_all_name']").val("");
		$("#" + id).parents("td").find("[name$='" + id + "_all_value'],[id$='" + id + "_all_value']").val("");
		$("#"+id).val("");
		$("#"+id+"_hideId").val("");
		$("#"+id+"_hideName").val("");
		$("#"+id+"_code").val("");
		$("#"+id+"_value").val("");
		$("#"+id+"_name").val("");
		$("#"+id + ",[name$='/"+id+"_code']" + ",[name$='/"+id+"_name'],[name$='/"+id+"_value']").val("");
	}
  function showText(obj){
	 
	  if(($(obj).attr("checked")=="checked")){
		  $("#"+$(obj).attr("name")+"_other").css("display","");
		  $("#"+$(obj).attr("name")+"_other").addClass("required");
	  }else{
		  $("#"+$(obj).attr("name")+"_other").css("display","none");
		  $("#"+$(obj).attr("name")+"_other").val("");
		  $("#"+$(obj).attr("name")+"_other").removeClass("required");
	  }
  }
  $(document).ready(function(){
	  if($("#innovate2_value").val().indexOf("03")!=-1){
		  $("#innovate2_other").css("display","");
		  $("#innovate2_other").addClass("required");
	  }
	  if($("#innovate_team_value").val().indexOf("03")!=-1){
		  $("#innovate_team_other").css("display","");
		  $("#innovate_team_other").addClass("required");
	  }
	  
  });
</script>
